from yolov8detect import detect_defects
from generate_report import generate_pdf_report
from query_defects import query_defects

image_path = "C:\\Users\\余果\\Desktop\\-yolo-llm-main\\uploads\\crazing_2.jpg"

defects = detect_defects(image_path)
print(defects)

# 查询数据库中的缺陷数据
db_defects = query_defects(image_keyword="uploads/crazing_2.jpg")
print("Database Defects:")
for defect in db_defects:
    print(defect)

#generate_pdf_report("D:\\lab\\detect\\report\\reportpdf\\defect_report.pdf", "D:/lab/detect/report/predict/orange1.jpg", defects)
